<?php 

$users = include_once './userdb.php';
//var_dump($users);
// array (size=1)
//   0 => 
//     array (size=4)
//       'username' => string 'l' (length=1)
//       'password' => string '202cb962ac59075b964b07152d234b70' (length=32)
//       'nikename' => string '蜗牛' (length=6)
//       'sex' => string '' (length=0)
include '../Msg/03-08-001.php';

foreach ($users as $v) {
	if($v['username']==$_POST['username'] && $v['password']==md5($_POST['password'])){
		session_start();
		$_SESSION['username']=$v['username'];
		$_SESSION['nikename']=$v['nikename'];
		$a=$_SESSION['nikename'].'  登陆成功';
		success($a,'./index.php',5);
		//echo '你好'.$v['nikename'].",登陆成功";
	}else{
		error("账号或密码错误",'./index.php');
		//echo "账号或密码错误";
	}
}















 ?>